<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function* go () {
      console.log(1);
      let a = yield 'a';
      console.log(2);

      let b = yield a;
      console.log(3);
      return b;
    }

    let it = go();
    let r1 = it.next();
    console.log(r1);
    let r2 = it.next('b的值');
    console.log(r2);
    let r4 = it.next('c的值');
    console.log(r4);
  </script>
</body>

</html>